<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<link rel="stylesheet" href="/js/chosen/chosen.css" />
<title>Untitled Document</title>

<style>
.addstaff{
	display:none;
	}

.attn{
	background-color:#FF8080;	
}

</style>

<script>
	$(function() {

		$( "#date" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
		$( "#date_end" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
		$( "#pay_date" ).datepicker({ dateFormat: "yy-mm-dd",firstDay: 1 });
		
	});


</script>

<script language="javascript">
	function refocus(theid){
		
		if(theid !=""){
			document.getElementById(theid).focus();
			}
		}
	function tickAll(source){
		if(source.checked){
			$('.tick').prop('checked',true);
		}else{
			$('.tick').prop('checked',false);
		}
	}
</script>
</head>

<body >
<form id = "form1" action="" method="post" enctype="multipart/form-data">
<div style="font-family:Arial, Helvetica, sans-serif" >


<?php 
  		$superComp = new Model_Payroll_Supercomp();
  		$superMethod = new Model_Payroll_Superpaymethod();
  		$stfInfo = new Model_DbTable_Roster_Staffinfo();
  		$stDetail = new Model_DbTable_Roster_Stafflogindetail();
  		$stList = $stDetail->listStaffByNickName();
  		$type = unserialize(PAYROLL_TYPE);
  		?>
<h2>Change Rate Approval</h2>

<h3>Pedning Case</h3>
<table border="1" cellspacing="0" cellpadding="5">
  <tr>
  	<th>Name</th>
  	<th>New Rate</th>
  	<th>New Rate Type</th>
  	<th>Current Rate</th>
  	<th>Current Rate Type</th>
  	<th>Effective Date</th>
  	<th>Action</th>
  	<th>Comment</th>
  	<th>Reason</th>
  </tr>
  <?php if(!empty($this->list)){?>
  
  <?php foreach ($this->list as $k => $v){
  		 	$stf = $stfInfo->getStaffinfo($v['staff_id']);
  		 	$stfD = $stDetail->getDetail($v['staff_id']);?>
  <tr>
  	<td><?php echo $stf['first_name']." ".$stf['last_name']."(".$stfD['ni'].")"?></td>
  	<td><input type = "text" name = "newRate[<?php echo $v['id']?>]" value = "<?php echo $v['new_rate']?>"></input></td>
  	<td><select name = "newRateType[<?php echo $v['id']?>]" class = "newRateType">
						<?php foreach ($type as $k2 => $v2){?>
						<option value = "<?php echo $k2;?>" <?php if($k2 == $v['new_rate_type']){?> selected <?php }?>>
							<?php echo $v2[1];?>
						</option>
						<?php }?>
					</select></td>
  	<td><?php echo $stf['old_rate']?></td>
  	<td><?php echo $type[$stf['id_package']][1]?></td>
  	<td><?php echo $v['effective_date']?><input type = "hidden" name = "effDate[<?php echo $v['id']?>]" value = "<?php echo $v['effective_date'];?>"></input></td>
  	<td>Tick:<input type = "checkbox" name = "checkBox[<?php echo $v['id']?>]" value = "<?php echo $v['staff_id']?>"></input></td>
  	<td><?php echo $v['comment']?></td>
  	<td><input type = "text" name = "reason[<?php echo $v['id']?>]"></input></td>
  </tr>
  <?php }
  	}?>
</table>
<br/>
</div>
	Input Password:<input type = "password" name = "password" ></input>
	<input type = "submit" name = "accept" id = "accept" value = "Accept"></input>
	<input type = "submit" name = "reject" id = "reject" value = "Reject"></input>
	
<br/><br/>
</form>

<h3>Summary</h3>
<table border="1" cellspacing="0" cellpadding="5">
  <tr>
  	<th>Name</th>
  	<th>New Rate</th>
  	<th>New Rate Type</th>
  	<th>Current Rate</th>
  	<th>Current Rate Type</th>
  	<th>Effective Date</th>
  	<th>Result</th>
  	<th>Reason</th>
  </tr>
  <?php if(!empty($this->result)){?>
  <?php foreach ($this->result as $k => $v){
  		 	$stf = $stfInfo->getStaffinfo($v['staff_id']);
  		 	$stfD = $stDetail->getDetail($v['staff_id']);?>
  <tr>
  	<td><?php echo $stf['first_name']." ".$stf['last_name']."(".$stfD['ni'].")"?></td>
  	<td><?php echo $v['new_rate']?></td>
  	<td><?php echo $type[$v['new_rate_type']][1]?></td>
  	<td><?php echo $stf['old_rate']?></td>
  	<td><?php echo $type[$stf['old_id_package']][1]?></td>
  	<td><?php echo $v['effective_date']?></td>
	<td><?php echo $v['result']?></td>
	<td><?php echo $v['reason']?></td>
  </tr>
  <?php }
  	}?>
</table>

</body>
</html>
